Reducing redirects

ABSTRACT

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for modifying search results. In one aspect, a method includes receiving data that specify a set of responsive resources for a search request that was submitted by a user device. A determination is made that a resource request for a particular resource from the set of responsive resources will cause the user device to be redirected to a different resource than the particular resource. In response to the determination a reference to the different resource is inserted into a search result for the particular resource. The search result for the particular resource is provided to the user device, where the search result includes the reference to the different resource.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.15/130,185, filed Apr. 15, 2016, which is a continuation of U.S.application Ser. No. 13/534,640, now U.S. Pat. No. 9,342,615, filed Jun.27, 2012, which claims the benefit of U.S. Provisional PatentApplication No. 61/567,758, filed Dec. 7, 2011. The disclosure of eachof the foregoing applications is incorporated herein by reference.

BACKGROUND

This specification relates to data processing and information retrieval.

The Internet provides access to a wide variety of resources such asimages, video or audio files, and web pages for particular subjects,book articles, or news articles. A search system can identify resourcesthat are responsive to a search query and provide search results thatreference the identified resources. Users can view the search results ona display device and request presentation of the resources throughinteraction with the search results. For example, in response to userinteraction with a search result, the resource that is referenced by thesearch result can be presented in the display in which the search resultwas presented.

SUMMARY

In general, one innovative aspect of the subject matter described inthis specification can be embodied in methods that include the actionsof receiving data that specify a set of responsive resources for asearch request that was submitted by a user device; determining, by adata processing apparatus, that a resource request for a particularresource from the set of responsive resources will cause the user deviceto be redirected to a different resource than the particular resource;in response to the determination, inserting, by a data processingapparatus, a reference to the different resource into a search resultfor the particular resource, the reference being configured to initiatea resource request for the different resource in response to userinteraction with the search result, the resource request being initiatedindependent of a resource request for the particular resource; andproviding the search result for the particular resource to the userdevice, the search result including the reference to the differentresource. Other embodiments of this aspect include correspondingsystems, apparatus, and computer programs, configured to perform theactions of the methods, encoded on computer storage devices.

These and other embodiments can each optionally include one or more ofthe following features. Determining that a request for the particularresource will cause the user device to be redirected to a differentresource can include determining that the user device is a mobiledevice; and determining that a resource request for the particularresource from a mobile device will cause the mobile device to beredirected.

Determining that a resource request for the particular resource from amobile device will cause the mobile device to be redirected can includereceiving redirect data specifying one or more resources that have beenidentified as a redirect resource, a redirect resource being a resourcethat will cause at least one user device to request a different resourcein response to a resource request for the redirect resource; determiningthat an identifier for the particular resource is included in theredirect data; and determining that the redirect data for the particularresource indicate that the particular resource causes mobile devices tobe redirected to the different resource in response to a request for theparticular resource from the mobile devices.

Methods can further include the action of determining that the redirectdata for the particular resource indicate that the particular resourcedoes not cause non-mobile devices to be redirected to the differentresource in response to a resource request for the particular resourcefrom the non-mobile devices.

Methods can further include the actions of receiving data that specify asearch result for the particular resource, the search result including alink to the particular resource; determining that the search result isbeing provided to a non-mobile device; and providing the search resultto the non-mobile device, the search result including the link to theparticular resource.

Methods can further include the actions of receiving, by the userdevice, the search result for the particular resource, the search resultincluding the reference to the different resource; determining, by theuser device, that a user interaction with the search result occurred;and requesting, by the user device, the different resource in responseto the user interaction with the search result.

Methods can further include the actions of determining that languagesetting data received from the user device specifies a particularlanguage for the user device. Determining that the request for theparticular resource will cause the user device to be redirected to adifferent resource can include determining that the different resourceis selected based, at least in part, on receiving, from the user device,the language setting data representing the particular language.

Methods can further include the actions of determining, by a dataprocessing apparatus, that the set of responsive resources includes abrand-based redirect resource, the brand-based redirect resource being aresource that causes a particular brand of user device to be redirectedto a brand-specific resource that is different than the brand-basedredirect resource; determining that brand-based redirect data for thebrand-based redirect resource is not available for at least one brand ofuser device; and providing a search result for the brand-based redirectresource to the user device, the search result for the brand-basedredirect resource including a reference to the brand-based redirectresource.

Methods can further include the actions of determining, by a dataprocessing apparatus, that the set of responsive resources includes alanguage-based redirect resource, the language-based redirect resourcebeing a resource that causes a user device having particular languagesetting data to be redirected to a language-specific resource that isdifferent than the language-based redirect resource; determining thatlanguage-based redirect data for the language-based redirect resource isnot available for at least one language setting; and providing a searchresult for the language-based redirect resource to the user device, thesearch result for the language-based redirect resource including areference to the language-based redirect resource.

Methods can further include the actions of determining, by a dataprocessing apparatus, that the set of responsive resources includes atransient redirect resource, the transient redirect resource being aresource that causes a user device to be redirected to a transientresource that is different than the transient redirect resource; andproviding a search result for the transient redirect resource to theuser device, the search result for the transient redirect resource notincluding a reference to the transient resource.

Particular embodiments of the subject matter described in thisspecification can be implemented so as to realize one or more of thefollowing advantages. Mobile search results (i.e., search results thatare provided to a mobile computing device) can link to a resource thathas been identified as a mobile resource rather than linking to adesktop resource (i.e., a resource that has not been identified as amobile resource). Linking a mobile search result to a mobile resourcecan prevent the mobile computing device from requesting the desktopresource prior to being redirected to the mobile resource. Reducing thenumber of redirects between user selection of a mobile search result andpresentation of the mobile resource can reduce the amount of timerequired to present the mobile resource.

The details of one or more embodiments of the subject matter describedin this specification are set forth in the accompanying drawings and thedescription below. Other features, aspects, and advantages of thesubject matter will become apparent from the description, the drawings,and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an example environment in which a searchsystem provides search services.

FIG. 2A is a block diagram of an example data flow for identifyingredirect resources.

FIG. 2B is a block diagram of an example data flow for reducingredirects.

FIG. 3 is a flow chart of an example process for reducing redirects.

FIG. 4 is block diagram of an example computer system.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

Search results that are provided in response to a search query specifyresources that have been identified as responsive to the search query(e.g., resources having at least a threshold relevance score for thesearch query). Each of the search results generally includes a link(e.g., an active hypertext link) to one of the resources that has beenidentified as responsive to the search query, and user interaction witha search result will initiate a request for the resource to which thesearch result is linked. For example, a search result for an electronicsretailer may include a hypertext link that initiates a request for ahome page of the retailer's web site in response to user interactionwith the search result.

In some situations, a request for a particular resource may cause theuser device to be redirected to another resource (i.e., a resourcedifferent than the requested resource). For example, some publisherscreate mobile resources that have been formatted for viewing on a mobiledevice, such as a mobile phone, and redirect a mobile device to themobile resource in response to a request from the mobile device for theparticular resource. A mobile resource is a resource that has beendetermined to have been formatted for presentation on mobile devices,and data identifying the resource as a mobile resource can be storedwith a reference to the resource to identify it as such. A mobileresource can include a resource to which mobile devices are redirectedin response to a request for another resource, when non-mobile devices(i.e., devices that have not been identified as mobile devices) are notredirected following a request for the other resource.

When it is determined that a request for a particular resources causes amobile device to be redirected to another resource, the search resultfor the particular resource can include a link (or another reference) tothe other resource to which the mobile device would otherwise beredirected. For example, the link to the other resource can be insertedinto the search result so that the mobile device requests the otherresource, rather than the particular resource, in response to userinteraction with the search result.

FIG. 1 is a block diagram of an example environment 100 in which asearch system 110 provides search services. The example environment 100includes a network 102, e.g., a local area network (LAN), wide areanetwork (WAN), the Internet, or a combination of them, connects websites 104, user devices 106, and the search system 110. The network 102can be accessed over a wired and/or a wireless communications link. Forexample, mobile computing devices, such as smartphones can utilize acellular network to access the network. The environment 100 may includemillions of web sites 104 and user devices 106.

A web site 104 is one or more resources 105 associated with a domainname and hosted by one or more servers. An example web site is acollection of web pages formatted in hypertext markup language (HTML)that can contain text, images, multimedia content, and programmingelements, e.g., scripts. Each web site 104 is maintained by a publisher,e.g., an entity that manages and/or owns the web site.

A resource 105 is data provided over the network 102 (e.g., by a website 104) and that is associated with a resource address. Resources 105include HTML pages, word processing documents, and portable documentformat (PDF) documents, images, video, and feed sources, to name just afew. The resources 105 can include content, e.g., words, phrases, imagesand sounds and may include embedded information (e.g., meta informationand hyperlinks) and/or embedded instructions (e.g., scripts).

A user device 106 is an electronic device that is under control of auser and is capable of requesting and receiving resources 105 over thenetwork 102. Example user devices 106 include personal computers, mobilecomputing devices (e.g., smartphones and/or tablet computing devices)that can send and receive data over the network 102. As used throughoutthis document the term mobile computing device (“mobile device”) refersto a user device that is configured to communicate over a mobilecommunications network. A smartphone (i.e., a phone that is enabled tocommunicate over the Internet) is an example of a mobile device.

A user device 106 typically includes a user application, e.g., a webbrowser, to facilitate the sending and receiving of data over thenetwork 102. Mobile devices may utilize a “mobile browser” to send andreceive data over the network 102. As used throughout this document, amobile browser is a browser that is identifiable as a browser that isinstalled on mobile devices. A mobile browser can be identified as such,for example, based on a version number or another identifier indicatingthat the browser is a mobile version of a browser. For example, abrowser developer may create a mobile browser specifically for use onmobile devices and assign that mobile browser a version number withwhich the mobile browser can be identified as such. As described in moredetail below, the version number of the browser and/or other informationabout the browser may be included in a user-agent header that isincluded in communications from the user device.

To facilitate searching of resources 105, the search system 110identifies the resources 105 by crawling and indexing the resources 105provided on web sites 104. Data about the resources 105 can be indexedbased on the resource to which the data corresponds. The indexed and,optionally, cached copies of the resources 105 are stored in a searchindex 112.

The user devices 106 submit search queries 109 to the search system 110.In response, the search system 110 accesses the search index 112 toidentify resources 105 that are relevant to (e.g., have at least aminimum specified relevance score for) the search query 109. The searchsystem 110 identifies the resources 105, generates search results 111that identify the resources 105, and returns the search results 111 tothe user devices 106.

A search result 111 is data generated by the search system 110 thatidentifies a resource 105 that is responsive to a particular searchquery, and can include a link to the resource 105. An example searchresult 111 can include a web page title, a snippet of text or a portionof an image extracted from the web page, and the URL of the web page.

The search results 111 (e.g., SR1, SR2, SR3) are presented in a searchresults page 114 that is displayed at the user device. User interactiona search result (e.g., SR1 115) causes the user device 106 to request aresource (e.g., Resource A 116) that is referenced by the search result.In some implementations, the user device 106 submits a hypertexttransfer protocol (“http”) request for a resource that is located at auniform resource locator (“URL”) specified by the search result withwhich the user interaction occurred. For example, user interaction withthe search result SR1 115 can cause the user device 106 request ResourceA 116 that is referenced by the search result SR1 115. In response tothe request, data that cause presentation of Resource A 116 may bereceived by the user device 106 and used to present Resource A 116 atthe user device 106.

In response to some resource requests, a redirect instruction (e.g.,data directing the user device to request data from another networklocation) is returned to the user device instead of (or in addition to)the data that cause presentation of the resource. For example, when arequest for Resource A 116 is received from a user device, a redirectinstruction may be provided to the user device 106 instructing the userdevice to request presentation of Resource B 118. The redirectinstruction can include a URL (or another network location) from whichthe user device 106 is to request data.

Redirect instructions may be provided to user devices for a variety ofreasons. For example, a redirect instruction may be provided to a userdevice 106 when data is unavailable from the network location from whichthe user device 106 requested the data. Redirects may also be providedto a particular type of user device in an effort to direct thatparticular type of user device to a resource that has been created forviewing on the particular device.

For example, some publishers create multiple versions of a particularweb page (or another resource), where one version of the web page isformatted for viewing on a mobile device, while another version of theweb page is formatted for viewing on a non-mobile device (i.e., a devicethat has not been identified as a mobile device). In this example, theversion of the web page that is formatted for viewing on a mobile devicemay use fewer graphics or lower resolution graphics, less multi-mediacontent, and/or a different aspect ratio than the version of the webpage that is formatted for viewing on a non-mobile device. As notedabove, resources that have been formatted for viewing on a mobile deviceare referred to as mobile resources, while resources that have beenformatted for viewing on a non-mobile device are referred to as desktopresources (e.g., a desktop web page) even though these resources may bepresented on any computing device.

When a publisher has created multiple versions of a web page (or anotherresource), a mobile device that requests a desktop web page may beautomatically redirected to the mobile web page that corresponds to thedesktop web page. For example, assume that Resource A 116 is a desktopweb page to which the search result SR1 115 links, and that the userdevice 106 is a mobile device that has requested Resource A 116. In thisexample, the mobile device may be automatically redirected to requestResource B 118 so that a mobile resource, rather than a desktopresource, is presented at the mobile device.

Some redirects are initiated based solely (or only in part) on whetherthe user device from which a request for a resource was received hasbeen identified as a mobile device, or a non-mobile device, and exampletechniques for determining whether a user device is a mobile device or adesktop device are described below. However, some redirects may be basedon data, such as a cookie, that is stored on the user device. Forexample, if a search provider also offers other online services, such asan online e-mail account, an online shopping cart, or other onlineservices (e.g., a social network, blog hosting, an image sharingservice, and/or a video sharing service), the online search provider mayplace one or more cookies on a user's device to enhance the user'sexperience (e.g., by storing user preferences or account information tofacilitate user-customized experiences).

A cookie is a data file that uniquely identifies a user device (e.g.,using a pseudo-random number or a data hash that anonymously identifiesthe user device). A cookie that is placed on a user device is generallyonly accessible by the entity that placed the cookie on the user device.For example, if a provider of search services (e.g., example.com) placesa cookie on a particular user device, the provider of the searchservices (e.g., example.com servers) will generally be the only entitythat is able to access to the cookie.

Cookies can be used to identify users that have previously visited aparticular web site (i.e., assuming that the user has agreed to havecookies stored on their device). For example, users of web-based mailservices may have a cookie stored on their user device when they log-into their e-mail account (e.g., by entering a user name and password).For a specified period of time following access to the e-mail account,the user may be able to return to directly to their e-mail accountwithout again manually entering a user name and/or password.

For example, assume that after navigating away from the web-based e-mailservice (e.g., navigating to an online newspaper or a search interface)the user device requests a log-in page for the web-based e-mail service.In this example, upon detection of the cookie that is stored on the userdevice (and a determination that the specified period has not passed),the user device may be redirected to a web page presenting the user'se-mail account without requiring the user to re-enter their user name orpassword. Web-based e-mail services have been used for purposes ofexample, but other online services that utilize cookies, such as anonline retailer, can also initiate redirects in response to detectingthe cookie.

Resources can also redirect user devices based on a brand (e.g., amanufacturer) of the user device. For example, a mobile phoneapplication developer may create a web page that user devices canrequest to purchase and/or download an application that has been createdby the developer. For purposes of illustration, assume that theapplication developer created a different version of the application fortwo or more different brands of phones (e.g., Brand A and Brand B) thateach use different operating systems (or different versions of the sameoperating system). In this example, the application for each of therespective versions of the application may be available from a differentnetwork location (e.g., a web page for an application marketplace).Therefore, to redirect Brand A user devices to another web page fromwhich the version of the application that was created for Brand A userdevices can be purchased and/or downloaded (e.g., an applicationmarketplace for Brand A phones). Similarly, the web page can beconfigured to redirect Brand B user devices to a web page from which theversion of the application that was created for Brand B user devices canbe purchased (e.g., an application marketplace for Brand B phones).

Each redirect that a user device is instructed to make results in arequest for a resource that is stored at a different network location.For example, when a user device is redirected to a particular resourcein response to requesting another resource, the user device will havemade two resource requests prior to receiving the data that causepresentation of the particular resource. As the number of redirects thata user device makes increases, the latency between the initial resourcerequest and presentation of a resource increases. Therefore, the latencybetween a resource request and presentation of a resource can be reducedby reducing the number of redirects that a user device is required tomake prior to presentation of a resource.

The environment 100 includes a redirect reduction apparatus 120 thatreduces the number of redirects that are performed by user devices. Theredirect reduction apparatus 120 is a data processing apparatus thatuses redirect data to determine whether a resource that is referenced bya search result is a redirect resource (i.e., a particular resource thatredirects a user device that requests the particular resource to adifferent resource). The redirect reduction apparatus 120 is representedas being an independent apparatus that communicates with the searchsystem 110 over the network 102, but in some implementations, theredirect reduction apparatus 120 could be implemented as part of thesearch system 120 or part of another system.

When the redirect reduction apparatus 120 determines, based at least inpart on the redirect data, that a redirect resource is referenced by(e.g., linked to) a particular search result, the redirect reductionapparatus 120 can insert, into the particular search result, a reference(e.g., a hypertext link) to the different resource to which redirectresource redirects user devices. Therefore, user interaction with theparticular search result will initiate a request for the differentresource, rather than a request for the redirect resource. Accordingly,the user device can request the different resource without firstrequesting the redirect resource.

The redirect data can be obtained, for example, from a redirect datastore 122. The redirect data store 122 is a data store that storesredirect data specifying a set of redirect resources and, for eachredirect resource in the set, different resources to which the redirectresource redirects user devices. For example, if user devices thatrequest Resource A 116 are redirected to Resource B 118, the redirectdata store 122 will include redirect data specifying the redirect fromResource A 116 to Resource B 118.

In some implementations, the redirect data can specify whether all, oronly proper subsets, of user devices that request a particular redirectresource are redirected in response to the request. For example, if onlydevices that have been identified as mobile devices are redirected toResource B 118 in response to a request for Resource A 116, the redirectdata for Resource A may specify that the redirect is conditioned on therequest for Resource A 116 being received from a mobile device.

The redirect data can further specify whether the redirect isconditioned on other factors, such as detection of a cookie on the userdevice from which the resource was requested. For example, if theredirect from Resource A 116 to Resource B 118 only occurs when aparticular cookie is determined to be stored on the user device, theredirect data for Resource A can specify that the redirect to Resource B118 is conditioned on the presence of the particular cookie (e.g., acookie that was previously placed on the user device by the publisher ofResource A). The redirect data can also specify any other redirectconditions that must be satisfied for a particular redirect to occur.

In some implementations, the redirect data can also specify whetherlanguage setting data from the user device is used by a resource toconditionally redirect user devices. The language setting data may bereceived from the user device with a search request and/or a request fora resource. The language setting data are data that indicate a languagein which information is presented at the user device. For example, alanguage setting of “en” may indicate that information presented on theuser device is presented in English, while a language setting of “de”may indicate that the information is presented in German. Somepublishers may create different versions of a particular page, forexample, to provide a region-specific version of the page, or a languagespecific version of the page. Therefore, when the publisher receives arequest for a particular home page (e.g., example.com), the publishermay redirect the user device to a language specific web page (e.g.,example.com/german).

FIG. 2A is a block diagram of an example data flow 200 for identifyingredirect resources. The data flow begins with the redirect reductionapparatus 120 initiating Resource Request A 202 that requests a resourcefrom a publisher server 204. Resource Request A can be, for example, anhttp request for a resource located at the network locationexample.com/page1. If the resource that is located at example.com/page1is a redirect resource, then publisher server 204 will respond toResource Request A 202 with redirect instructions 206 that includes anetwork location 207 from which the redirect reduction apparatus 120 isto request another resource. For example, in response to receiving arequest for the resource located at example.com/page1, the publisherserver 204 may provide the redirect instructions 206 that instruct theredirect apparatus 120 to request data from example.com/page2, ratherthan providing data that cause presentation of a resource.

When the redirect reduction apparatus 120 receives the redirectinstructions 206, the redirect reduction apparatus 120 initiates anotherresource request. For example, the redirect reduction apparatus 120 caninitiate Resource Request B 208 that requests the resource located atexample.com/page2. If the resource located at example.com/page2 is not aredirect resource, the publisher server 204 may respond to the requestby providing resource data 210 that cause presentation of the resourcethat is located at example.com/page2. However, if the resource locatedat example.com/page2 is another redirect resource, the publisher server204 will again provide redirect instructions that redirect the redirectreduction apparatus 120 to another network location, and the requestprocess can iteratively continue until a resource is presented and/or atimeout (e.g., a maximum number of redirects or a maximum elapsed timefollowing the initial resource request) occurs.

In response to receiving the resource data 210, the redirect reductionapparatus 120 can confirm that the resource data 210 does not includeredirect instructions, and therefore, determine that the resource thatwas provided in response to Resource Request B 208 is a standardresource (i.e., a resource that does not redirect the user device inresponse to the resource request) rather than a redirect resource. Inturn, the redirect reduction apparatus 120 can store redirect data 212in the redirect index 122. In this example, the redirect data 212 thatare stored can indicate that a request for example.com/page1 (e.g.,“Page₁”) will redirect a user device to example.com/page2 (e.g.,“Page₂”), as represented by the notation “Page₁:Page₂” in FIG. 2A. Theredirect data can also specify other redirect resources (e.g., Page₃ andPage_(x)) that redirect user devices to other standard resources (e.g.,Page₄ and Page_(y), respectively). Note that if multiple redirects occurbetween a first requested resource (e.g., Page_(x)) and presentation ofa resource that is not a redirect resource, data indicating eachintervening redirect resource (or a proper subset thereof) can be storedin the redirect index. Alternatively, or additionally, resource data 212specifying only the initially requested redirect resource and thestandard resource that was presented following the last redirect can bestored.

In some implementations, multiple redirect reduction apparatus 120 areused to request the same resource. In these implementations, eachredirect reduction apparatus 120 can emulate a different type of userdevice, such that different redirect behaviors for different resourcescan be detected, and a particular resource can be identified as aredirect resource or a standard resource on a per-device basis.

For example, one redirect reduction apparatus 120 can emulate asmartphone, while another redirect reduction apparatus can emulate adesktop device. In this example, the redirect data 212 that are obtainedusing each of the redirect reduction apparatus can be compared todetermine whether a resource conditions redirects based on the type ofuser device that has requested the resource. For example, if aparticular resource redirects mobile devices, but does not redirectdesktop devices, this conditional redirect behavior can be detectedusing both a redirect reduction apparatus 120 that emulates a desktopdevice and a redirection reduction apparatus 120 that emulates a mobiledevice.

A redirect reduction apparatus 120 can emulate a particular type of userdevice, for example, using a user-agent header (or other deviceidentification data) that specifies the type of device from which aresource request was initiated and/or other details about the devicethat initiated the resource request. For example, as described in moredetail with reference to FIG. 3, the agent-header can specifyinformation that enables a publisher server 204 to determine whether auser device that requests a resource is a mobile device or a desktopdevice, and/or a manufacturer of the device. Thus, depending on theuser-agent header (or other device identification data) used by theredirect reduction apparatus, the redirect reduction apparatus 120 (oranother data processing apparatus) that requests a resource may beconsidered a mobile device or a desktop device by a publisher server204, such that the redirect reduction apparatus 120 can obtain redirectdata for different types of user devices. Redirect data for each type ofdevice can be stored in the redirect index to create a redirect profilefor each redirect resource.

In some implementations, the redirect reduction apparatus 120 isconfigured to emulate one particular brand (or model) of mobile device,such that redirect data is collected for that particular brand (ormodel). Similarly, the redirect reduction apparatus 120 may beconfigured to present information is a single language (e.g., English),such that the language setting data for the redirect reduction apparatus120 is static over time. For example, instead of initiating multiplerequests for a particular resource using different user-agent headers,the redirect reduction apparatus 120 may use the same user-agent headerfor each resource request in order to reduce the processing resourcesrequired to obtain redirect data for many different resources.

When the redirect reduction apparatus 120 emulates only a proper subsetof all user device configurations, it is possible that the redirect datafor a particular redirect resource may not explicitly specify whetherdifferent types of user devices are redirected to different resources,or whether redirects are conditioned on language setting data for theuser device. For example, although the redirect data may specify thatBrand A user devices are redirected to another resource in response to arequest for the particular resource (e.g., assuming that the redirectreduction apparatus 120 is configured to emulate a Brand A user device),the redirect data may not specify whether Brand B user devices areredirected (e.g., because the reduction apparatus 120 may not haverequested the particular resource while emulating a Brand B device).Similarly, the redirect data may specify whether user devices using aparticular language setting are redirected, while not specifying whetheruser devices using other language settings are also redirected.

In some implementations, the redirect reduction apparatus 120 can beconfigured to determine whether a search result for a particularresource should continue to link to the particular resource (e.g.,rather than another resource) even though the particular resource hasbeen identified as a redirect resource. In some implementations, thedetermination can be based, at least in part, on the redirect data forthe resource and an analysis of a redirect chain for the particularresource. The redirect chain specifies two or more resources that arerequested by a user device when a user device requests the particularresource. For example, if a user device requests Resource X and is thenredirected to Resource Y, the redirect chain in this example may includethe URL for Resource X and the URL for Resource Y (e.g.,http//:example.com/>http://example.com/BrandA_Store).

In some implementations, the redirect reduction apparatus 120 candetermine that a search result for a particular redirect resource willinclude a link to the particular redirect resource when the redirectresource is determined to be a “brand-based” redirect resource and onlypartial brand-based redirect data are available. Continuing with theexample above, assume that the redirect reduction apparatus 120 thatcollected the redirect data was configured to emulate only a Brand Auser device and not a Brand B device, and further assume that theResource Y was a web page for an application store from which users ofBrand A user devices can download applications that have been createdfor Brand A devices. In this example, the redirect data for theparticular resource will specify that Brand A devices that requestResource X are redirected to Resource Y, but will not specify whether(or to what resource) Brand B devices are redirected, such that theredirect reduction apparatus 120 can determine that only partialbrand-based redirect data are available.

In these implementations, when only partial brand-based redirect dataare available, the redirect reduction apparatus 120 can inspect the URLsand/or content of the redirect resource and/or the different resource towhich the redirect resource redirects user devices to determine whetherthe different resource to which the user devices are redirected isbrand-specific resource. For example, if the URL of the differentresource includes a reference to the particular brand, e.g., Brand A,and the redirect reduction apparatus 120 was emulating a Brand A device(i.e., a device of the same particular brand), then the differentresource can be determined to be a brand-specific resource. Similarly,if the content of the redirect resource includes links to brand specificsites, e.g., links to sites that sell applications for Brand A phones,then the redirect initiated by the redirect resource can be considered abrand-based redirect. In turn, the redirect reduction apparatus 120 candetermine that search results for the redirect resource will continue toinclude a link to the redirect resource (i.e., rather than beingmodified to include a link to the different resource) since the redirectwas determined to be a brand-based redirect and brand-based redirectdata was not available for at least one brand of user device, e.g.,Brand B user devices. Data representing the outcome of thisdetermination (e.g., brand-based data) can be stored, for example, inthe redirect index 122.

The redirect reduction apparatus 120 can be configured to make a similardetermination with respect to language-based redirect resources. In someimplementations, the redirect reduction apparatus 120 will not modify asearch result for a language-based redirect resource when the redirectis determined to be a language-based redirect and only partiallanguage-based redirect data are available (i.e., redirect data are notavailable for at least one language setting). For example, assume thatthe redirect reduction apparatus 120 uses static language setting data,such that language-based redirect data are only available for a singlelanguage. In this example, the redirect data for a redirect resourcewill specify whether user devices having the same language setting dataas the redirect reduction apparatus 120 will be redirected, but will notspecify whether other user devices having other language setting datawill also be redirected, or to where those other user devices would beredirected. Therefore, in this example, the redirect reduction apparatus120 can determine that only partial language-based redirect data areavailable.

In some implementations, the redirect reduction apparatus 120 canexamine the URL and/or content language for the redirect resources whenonly partial language-based redirect data are available. For example,the redirect reduction apparatus can examine the URLexample.com/page3/en to which the page example.com/page2 redirects anddetermine that the URL includes the characters “en” which correspond tothe language setting data for the English language. Similarly, theredirect reduction apparatus may examine the text of example.com/page2and the text of example.com/en to determine whether the language of eachof the resources is different. If the languages of two pages aredetermined to be different or the URL for the resource to which a userdevice is redirected includes a reference to the language setting datafor the user device, the redirect reduction apparatus 120 can considerthe redirect a language-based redirect. In turn, the redirect reductionapparatus 120 can determine that search results for the redirectresource will continue to include a link to the redirect resource (i.e.,rather than being modified to include a link to the different resource)since the redirect was determined to be a language-based redirect andonly partial language-based redirect data were determined to beavailable. Data specifying the outcome of this determination (e.g.,language-based data) can be stored, for example, in the redirect index122.

In some implementations, the redirect reduction apparatus 120 isconfigured to determine that a redirect chain for a particular redirectresource includes a transient link, such that the particular redirectresource is considered a transient redirect resource. In theseimplementations, the redirect reduction apparatus 120 can prevent thetransient resource from being referenced by a search result for thetransient redirect resource and determine which resource should bereferenced by a search result for the transient redirect resource. Forexample, assume that the particular redirect resource includes thefollowing redirect chain:http://example.com>http://example.com/m>http://example.com/2011/1/1?id=xxxyyyzzz.In this example, the redirect reduction apparatus 120 may determine thatthe URL http://example.com/2011/1/1?id=xxxyyyzzz has a structure that issimilar to URLs for other known transient resources (e.g., resourcesthat are relocated or removed after a specified period), and thereforedetermine that the search result for example.com should not include alink to the transient resource. Therefore, the redirect reductionapparatus 120 can either not modify the search result for example.com orinsert a link to the resource that is located at example.com/m.

The redirect reduction apparatus 120 can also identify transientresources, for example, by comparing over time the redirect chain for aparticular redirect resource. For example, assume that example.com wasfirst determined to have the following redirect chain:http://example.com>http://example.com/m>http//example.com/2011/1/1?id=xxxyyyzzz,and on a next request for example.com was determined to have thefollowing redirect chain:http://example.com>http://example.com/m>http//example.com/2011/1/5?id=yyyxxxzzz.In this example, the last link in each instance of the redirect chain(e.g., example.com/2011/1/1?id=xxxyyyzzz andexample.com//2011/1/5?id=yyyxxxzzz) can be determined to be transientresources, such that the redirect reduction apparatus 120 may not inserta link to these resources into a search result for example.com. In someimplementations, a redirect chain can be required to have at least aminimum specified rate of change in order to classify a resource in thechain as a transient resource. Data specifying the outcome of thisdetermination (e.g., transient resource data) can be stored for example,in the redirect index 122.

FIG. 2B is a block diagram of an example data flow 250 for reducingredirects. The data flow 250 begins with a user device 106 submitting aquery 109 to a search system 110. The query can also be provided to theredirect reduction apparatus 120 either by the user device 106 or by thesearch system 110. As described above with reference to FIG. 1, thesearch system 110 identifies resources that are responsive to the searchquery 110 (“responsive resources”) and generates search results 111 thatreference (e.g., link to) the responsive resources. Each search resultcan include, for example, a hypertext link that upon user interactionwith the search result causes the user device to initiate a request forthe resource that is at the network location specified in the hypertextlink. For example, search result SR1 in FIG. 2B can include a hypertextlink that includes the URL http://example.com/page1, such that userinteraction with search result SR1 will cause the user device 106 torequest the resource from example.com/page1.

The search system 110 provides data specifying one or more of the searchresults 111 to the redirect reduction apparatus 120. The redirectreduction apparatus 120 can compare the resources that are referenced by(e.g., linked to) the search results 111 to the list of redirectresources that are listed in the redirect index 122 to determine if anyresource referenced by the search results is a redirect resource. Forexample, the redirect reduction apparatus 120 can compare the networklocation in the hypertext link of each search result (e.g.,http://example.com/page1) to network locations of the redirect resourceslisted in the redirect index 122. If one of the search results 111 isdetermined reference a redirect resource, the hypertext link for thatsearch result can be replaced with a hypertext link to the standardresource to which the redirect resource redirects user devices. Thus,user interaction with that search result will cause the user device torequest the standard resource without first requesting the redirectresource.

For example, assume that SR1 includes a hypertext link toexample.com/page1, and that the redirect reduction apparatus 120determines that the resource that is located at example.com/page1 islisted as a redirect resource in the redirect index 122. Further assumethat according to the redirect index 122 the redirect resource atexample.com/page1 redirects user devices to a standard resource that islocated at example.com/page2. In this example, the redirect reductionapparatus 120 can insert a hypertext link to example.com/page2 into SR1and/or remove or disable the hypertext link to example.com/page1 thatwas initially included in SR1, thereby creating a set of modified searchresults 222. In turn, the redirect reduction apparatus 120 can providethe set of modified search results 222 to the user device forpresentation in a search results page 114.

When a user interacts with the modified version of SR1 115, thehypertext link to example.com/page2 will cause the user device 106 tosubmit Resource Request B 208 to the publisher server 204, and thepublisher server 204 will respond to the user device 106 with resourcedata 210 that cause presentation of the resource that is located atexample.com/page2. Thus, in this example, user interaction with SR1 115will cause the user device 106 to request the resource fromexample.com/page2 without first requesting the redirect resource that islocated at example.com/page1, thereby reducing the number of redirectsthat the user device will make before presentation of the resource thatis located at example.com/page2.

In some implementations, the visual appearance of a search result for aredirect resource is not changed when the search result becomes amodified search that links to a standard resource. For example, aftermodification SR1 115 may still visually indicate that SR1 is a searchresult for a resource that is located at example.com/page1, even thoughuser interaction with the search result will initiate a request for theresource at example.com/page2. In some implementations, a modifiedsearch result is visually altered such that the network location fromwhich the standard resource will be requested in response to userinteraction with the modified search result matches the network locationthat is visually referenced by the modified search result.

FIG. 3 is a flow chart of an example process 300 for reducing redirects.The process 300 can be implemented, for example, by a data processingapparatus, such as the redirect reduction apparatus 120 of FIG. 1. Theprocess 300 can also be implemented as instructions stored on computerstorage medium such that execution of the instructions by a dataprocessing apparatus cause the data processing apparatus to perform theoperations of the process 300.

A search request is received from a user device (302). In someimplementations, the search request includes a search query (e.g., textand/or images) with which search results will be selected. The searchrequest can be received, for example, from a mobile device, such as a“smartphone” that has Internet connectivity, and be received over acellular network or another wireless network. The search request can bereceived, for example, by a search system and/or another data processingapparatus, such as the redirect apparatus 120 of FIG. 1. Note that theredirect apparatus 120 can also receive data specifying that the searchrequest was received and/or data from the search request withoutreceiving the actual search request. For example, the search system 110of FIG. 1, or another data processing apparatus may provide the data tothe redirect apparatus 120.

Device identification data for the user device are received (304).Device identification data are data that specify a type of device fromwhich the search request was initiated and/or submitted. For example,the device identification data can include a user-agent header thatspecifies a manufacturer (or brand) of the user device and/or a model ofthe user device. The user-agent header may include, for example, dataspecifying that a particular search request was submitted by a userdevice manufactured by Brand-X Phone Co, and that the model number isBXP-100.

The device identification data may also include version data specifyinga hardware and/or software configuration of the user device. Forexample, the user-agent header may include data specifying a firmwareversion that is currently installed on the user device and/orinformation about the browser from which the search request wasinitiated. Additionally, the user-agent header may indicate a type ofbrowser from which the search request was submitted.

The device identification data can be used to determine whether the userdevice from which the search request was initiated is a mobile device,such as a smartphone, or whether the user device is a laptop or desktopdevice. In some implementations, the brand and model information may becross-referenced with a list of brands and models of mobile devices. Forexample, assume that model BXP-100 from Brand-X Phone Co. is included ona list of smartphones. In this example, search requests that arereceived from user devices having device identification data specifyinga manufacturer of Brand-X and a model BXP-100 can be considered to havebeen received from a mobile user device.

In some implementations, a type of user device that submitted the searchrequest can be based on the type of browser that was used to submit thesearch request. For example, mobile devices may use mobile versions ofbrowsers (e.g., rather than/or in addition to desktop versions of thebrowsers). Therefore, search requests that are received from userdevices having agent-user headers that specify a mobile version of abrowser can be considered to have been received from a mobile device,such as a smartphone or a non-mobile device, such as a desktop computer.

Data that specify a set of responsive resources for the search requestare received (306). In some implementations, the data that specify a setof responsive resources are data that specify a set of search resultsfor the resources. The data that specify a set of search results can bereceived, for example, from a search system that has generated thesearch results in response to the search request. The data can specify,for each search result, any of the information that is specified by thesearch result including, for example, the resource that is referenced bythe search result and/or the network location of the resource.

A determination is made whether a request for one or more of theresponsive resources will cause the user device to be redirected to adifferent resource (308). In some implementations, the determination canbe made based on redirect data that have been indexed and/or stored withreference to resources from the set of resources. For example, asdescribed above, a network location for a particular responsive resourcecan be compared to network locations for a set of known redirectresources that are specified by redirect data. If the network location(e.g., a URL) for the particular responsive resource does not match anetwork location (e.g., a URL) for one of the redirect resources, theparticular responsive resource can be considered to not be a redirectresource (i.e., be a standard resource). Thus, a request for theparticular responsive resource can be determined to not cause the userdevice to be redirected to a different resource than that located at thenetwork location for the particular responsive resource. If each of theresponsive resources in the set is determined to not be a redirectresource, search results for the set of responsive resources areprovided to the user device (312).

If the network location (e.g., a URL) for a particular responsiveresource matches a network location (e.g., a URL) for one of theredirect resources (or is otherwise identified as being a redirectresource), the particular responsive resource can be considered to be aredirect resource (i.e., that will redirect the user device to adifferent resource). Thus, a request for the particular responsiveresource can be determined to cause the user device to be redirected toa different resource other than the particular responsive resource.

If the particular resource is determined to be a redirect resource basedon a match between the network location of the particular responsiveresource and a redirect resource, a reference to the different resourcecan be inserted into a search result for the particular resource (310),as described in more detail below. However, further determinations maybe made prior to inserting the reference to the different resource.

As described above, the determination that a particular responsiveresource is a redirect resource can be conditioned on factors inaddition to the particular responsive resource having a URL that matchesa URL specified in the redirect data. For example, redirects by aparticular responsive resource may be conditioned on a type of device(e.g., mobile device) that is requesting the resource, a manufacturer ofthe device, whether the user device is storing a particular cookie (orother data file), such as a cookie that was placed on the user device bythe entity that provides both the search system and the particularresponsive resource, and/or language setting data that are received fromthe user device. Therefore, the determination of whether a request for aparticular responsive resource will cause the user device to beredirected to a different resource may be based, at least in part, onwhether characteristics of the user device match the conditions forredirect, which are referred to as redirect conditions.

As described above, the redirect conditions for a particular redirectresource can be stored, for example, in the redirect data for theparticular redirect resource. For example, the redirect data for theparticular responsive resource can specify whether the particularresponsive resource redirects all user devices, only mobile devices,only non-mobile user devices, or some combination of mobile and/ornon-mobile user devices (e.g., based on language setting data,manufacturer, or cookie status—i.e., whether the user device is storinga particular cookie).

In some implementations, when the user device is determined to be amobile user device (e.g., based on the device identification data), adetermination can be made whether the particular responsive resourceredirects mobile devices to the different resource. The determinationcan be made, for example, based on whether redirect data for theparticular responsive resource indicate that the particular responsiveresource redirects mobile devices to a different resource. If mobiledevices are determined to be redirected to the different resource(assuming that any other redirect conditions are satisfied), thereference to the different resource can be inserted into the searchresult for the particular responsive resource (312) independent ofwhether the particular responsive resource redirects non-mobile devices.If mobile devices are determine to not be redirected to a differentresource by the particular responsive resource, the search result forthe particular responsive resource can be provided without inserting thereference to the different resource.

When the user device is determined to be a non-mobile user device (i.e.,a user device that has not been identified as a mobile device), adetermination can similarly be made whether the particular responsiveresource redirects non-mobile user devices to the different resource.The determination can be made, for example, based on whether redirectdata for the particular responsive resource indicate that the particularresponsive resource redirects non-mobile devices to a differentresource.

If non-mobile devices are determined to be redirected to the differentresource (assuming that any other redirect conditions are satisfied),the reference to the different resource can be inserted into the searchresult for the particular responsive resource (312) independent ofwhether the particular responsive resource redirects mobile devices. Ifnon-mobile devices are determined to not be redirected to a differentresource by the particular responsive resource, the search result forthe particular responsive resource can be provided to the non-mobiledevice without inserting the reference to the different resource. Thus,a search result for the particular responsive resource that is providedto a non-mobile device may not have a reference to the differentresource to which mobile devices are redirected, even if the referenceto the different resource has been inserted into another search resultfor the particular responsive resource that is provided to a mobiledevice. Accordingly, the link that is included in different searchresults for the same resource can vary based on the type of device towhich the search result is being provided.

Similar techniques can be used to determine whether a cookie-basedredirect condition is satisfied for a particular responsive resource.For example, a determination can be made whether the user device isstoring a cookie for the particular responsive resource that isreferenced by a search result. As noted above, the cookie for theparticular responsive resource can be detected by a search system whenthe entity that provides the search system is the same entity thatprovides the particular responsive resource. For example, if an entitythat provides an online search system and an online video sharing siteplaces a cookie on the user device, that entity can detect the cookiewhen a search request is received from the user device.

If the user device is storing a cookie for the particular responsiveresource, the redirect data for the particular responsive resource canbe inspected to determine whether the particular responsive resourceredirects user devices that are storing the cookie (assuming that anyother redirect conditions are also satisfied). If the particularresponsive resource is determined to not redirect user devices based onthe cookie being stored on the user device, the search result for theparticular responsive resource can be provided without inserting areference to a different resource. However, if the particular responsiveresource is determined to redirect user devices that are storing thecookie to a different resource, a reference to the different resource isinserted into the search result for the particular responsive resource.

In this example, the search results for the particular responsiveresource that are provided to user devices storing the cookie willinclude a link to the different resource, while other search results forthe same particular responsive resource that are provided to userdevices not storing the cookie will not include the link to thedifferent resource. Accordingly, user interaction with the searchresults for the particular responsive resource that are provided to theuser devices storing the cookie will cause the user devices to request adifferent resource than the resources that are requested through userinteraction with search results for the same particular responsiveresource that are provided to user devices that are not storing thecookie.

In some implementations, a determination whether a redirect by theparticular responsive resource is conditioned on receiving particularlanguage setting data from the user device. For example, a user devicethat provides language setting data of“en” may be redirected to a webpage that was published in English, while a user device that provideslanguage setting data of “fr” may be redirected to a web page that waspublished in French. Thus, the redirect of a particular user device maybe conditioned on the language setting data that are provided by theuser device with a request for the resource and/or the search request.

Search results are provided to the user device (312). If at least one ofthe responsive resources were identified as redirect resources for theuser device that submitted the search request, the search results caninclude at least one modified search result in which a reference (e.g.,a hypertext link) to a different resource (i.e., different than theredirect resource) has been inserted, such that user interaction with amodified search result will initiate a request for the differentresource without first requesting the redirect resource. If none of theresponsive resources were identified as redirect resources, each of thesearch results can be provided to the user device without inserting anew reference to a different resource.

FIG. 4 is block diagram of an example computer system 400 that can beused to perform operations described above. The system 400 includes aprocessor 410, a memory 420, a storage device 430, and an input/outputdevice 440. Each of the components 410, 420, 430, and 440 can beinterconnected, for example, using a system bus 450. The processor 410is capable of processing instructions for execution within the system400. In one implementation, the processor 410 is a single-threadedprocessor. In another implementation, the processor 410 is amulti-threaded processor. The processor 410 is capable of processinginstructions stored in the memory 420 or on the storage device 430.

The memory 420 stores information within the system 400. In oneimplementation, the memory 420 is a computer-readable medium. In oneimplementation, the memory 420 is a volatile memory unit. In anotherimplementation, the memory 420 is a non-volatile memory unit.

The storage device 430 is capable of providing mass storage for thesystem 400. In one implementation, the storage device 430 is acomputer-readable medium. In various different implementations, thestorage device 430 can include, for example, a hard disk device, anoptical disk device, a storage device that is shared over a network bymultiple computing devices (e.g., a cloud storage device), or some otherlarge capacity storage device.

The input/output device 440 provides input/output operations for thesystem 400. In one implementation, the input/output device 440 caninclude one or more of a network interface devices, e.g., an Ethernetcard, a serial communication device, e.g., and RS-232 port, and/or awireless interface device, e.g., and 802.11 card. In anotherimplementation, the input/output device can include driver devicesconfigured to receive input data and send output data to otherinput/output devices, e.g., keyboard, printer and display devices 460.Other implementations, however, can also be used, such as mobilecomputing devices, mobile communication devices, set-top box televisionclient devices, etc.

Although an example processing system has been described in FIG. 4,implementations of the subject matter and the functional operationsdescribed in this specification can be implemented in other types ofdigital electronic circuitry, or in computer software, firmware, orhardware, including the structures disclosed in this specification andtheir structural equivalents, or in combinations of one or more of them.

Embodiments of the subject matter and the operations described in thisspecification can be implemented in digital electronic circuitry, or incomputer software, firmware, or hardware, including the structuresdisclosed in this specification and their structural equivalents, or incombinations of one or more of them. Embodiments of the subject matterdescribed in this specification can be implemented as one or morecomputer programs, i.e., one or more modules of computer programinstructions, encoded on computer storage medium for execution by, or tocontrol the operation of, data processing apparatus. Alternatively or inaddition, the program instructions can be encoded on anartificially-generated propagated signal, e.g., a machine-generatedelectrical, optical, or electromagnetic signal, that is generated toencode information for transmission to suitable receiver apparatus forexecution by a data processing apparatus. A computer storage medium canbe, or be included in, a computer-readable storage device, acomputer-readable storage substrate, a random or serial access memoryarray or device, or a combination of one or more of them. Moreover,while a computer storage medium is not a propagated signal, a computerstorage medium can be a source or destination of computer programinstructions encoded in an artificially-generated propagated signal. Thecomputer storage medium can also be, or be included in, one or moreseparate physical components or media (e.g., multiple CDs, disks, orother storage devices).

The operations described in this specification can be implemented asoperations performed by a data processing apparatus on data stored onone or more computer-readable storage devices or received from othersources.

The term “data processing apparatus” encompasses all kinds of apparatus,devices, and machines for processing data, including by way of example aprogrammable processor, a computer, a system on a chip, or multipleones, or combinations, of the foregoing The apparatus can includespecial purpose logic circuitry, e.g., an FPGA (field programmable gatearray) or an ASIC (application-specific integrated circuit). Theapparatus can also include, in addition to hardware, code that createsan execution environment for the computer program in question, e.g.,code that constitutes processor firmware, a protocol stack, a databasemanagement system, an operating system, a cross-platform runtimeenvironment, a virtual machine, or a combination of one or more of them.The apparatus and execution environment can realize various differentcomputing model infrastructures, such as web services, distributedcomputing and grid computing infrastructures.

A computer program (also known as a program, software, softwareapplication, script, or code) can be written in any form of programminglanguage, including compiled or interpreted languages, declarative orprocedural languages, and it can be deployed in any form, including as astand-alone program or as a module, component, subroutine, object, orother unit suitable for use in a computing environment. A computerprogram may, but need not, correspond to a file in a file system. Aprogram can be stored in a portion of a file that holds other programsor data (e.g., one or more scripts stored in a markup languagedocument), in a single file dedicated to the program in question, or inmultiple coordinated files (e.g., files that store one or more modules,sub-programs, or portions of code). A computer program can be deployedto be executed on one computer or on multiple computers that are locatedat one site or distributed across multiple sites and interconnected by acommunication network.

The processes and logic flows described in this specification can beperformed by one or more programmable processors executing one or morecomputer programs to perform actions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatus can also be implemented as, special purpose logiccircuitry, e.g., an FPGA (field programmable gate array) or an ASIC(application-specific integrated circuit).

Processors suitable for the execution of a computer program include, byway of example, both general and special purpose microprocessors, andany one or more processors of any kind of digital computer. Generally, aprocessor will receive instructions and data from a read-only memory ora random access memory or both. The essential elements of a computer area processor for performing actions in accordance with instructions andone or more memory devices for storing instructions and data. Generally,a computer will also include, or be operatively coupled to receive datafrom or transfer data to, or both, one or more mass storage devices forstoring data, e.g., magnetic, magneto-optical disks, or optical disks.However, a computer need not have such devices. Moreover, a computer canbe embedded in another device, e.g., a mobile telephone, a personaldigital assistant (PDA), a mobile audio or video player, a game console,a Global Positioning System (GPS) receiver, or a portable storage device(e.g., a universal serial bus (USB) flash drive), to name just a few.Devices suitable for storing computer program instructions and datainclude all forms of non-volatile memory, media and memory devices,including by way of example semiconductor memory devices, e.g., EPROM,EEPROM, and flash memory devices; magnetic disks, e.g., internal harddisks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROMdisks. The processor and the memory can be supplemented by, orincorporated in, special purpose logic circuitry.

To provide for interaction with a user, embodiments of the subjectmatter described in this specification can be implemented on a computerhaving a display device, e.g., a CRT (cathode ray tube) or LCD (liquidcrystal display) monitor, for displaying information to the user and akeyboard and a pointing device, e.g., a mouse or a trackball, by whichthe user can provide input to the computer. Other kinds of devices canbe used to provide for interaction with a user as well; for example,feedback provided to the user can be any form of sensory feedback, e.g.,visual feedback, auditory feedback, or tactile feedback; and input fromthe user can be received in any form, including acoustic, speech, ortactile input. In addition, a computer can interact with a user bysending documents to and receiving documents from a device that is usedby the user; for example, by sending web pages to a web browser on auser's client device in response to requests received from the webbrowser.

Embodiments of the subject matter described in this specification can beimplemented in a computing system that includes a back-end component,e.g., as a data server, or that includes a middleware component, e.g.,an application server, or that includes a front-end component, e.g., aclient computer having a graphical user interface or a Web browserthrough which a user can interact with an implementation of the subjectmatter described in this specification, or any combination of one ormore such back-end, middleware, or front-end components. The componentsof the system can be interconnected by any form or medium of digitaldata communication, e.g., a communication network. Examples ofcommunication networks include a local area network (“LAN”) and a widearea network (“WAN”), an inter-network (e.g., the Internet), andpeer-to-peer networks (e.g., ad hoc peer-to-peer networks).

The computing system can include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other. In someembodiments, a server transmits data (e.g., an HTML page) to a clientdevice (e.g., for purposes of displaying data to and receiving userinput from a user interacting with the client device). Data generated atthe client device (e.g., a result of the user interaction) can bereceived from the client device at the server.

While this specification contains many specific implementation details,these should not be construed as limitations on the scope of anyinventions or of what may be claimed, but rather as descriptions offeatures specific to particular embodiments of particular inventions.Certain features that are described in this specification in the contextof separate embodiments can also be implemented in combination in asingle embodiment. Conversely, various features that are described inthe context of a single embodiment can also be implemented in multipleembodiments separately or in any suitable subcombination. Moreover,although features may be described above as acting in certaincombinations and even initially claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. In certain circumstances, multitasking and parallel processingmay be advantageous. Moreover, the separation of various systemcomponents in the embodiments described above should not be understoodas requiring such separation in all embodiments, and it should beunderstood that the described program components and systems cangenerally be integrated together in a single software product orpackaged into multiple software products.

Thus, particular embodiments of the subject matter have been described.Other embodiments are within the scope of the following claims. In somecases, the actions recited in the claims can be performed in a differentorder and still achieve desirable results. In addition, the processesdepicted in the accompanying figures do not necessarily require theparticular order shown, or sequential order, to achieve desirableresults. In certain implementations, multitasking and parallelprocessing may be advantageous.

1. (canceled)
 2. A method performed by data processing apparatus, the method comprising: receiving data that specify a set of responsive resources for a search request that was submitted by a user device, and identification data indicating that the user device is a user device of a first type; determining, by a data processing apparatus and prior to providing search results in response to the search request, that a redirect for a particular resource from the set of responsive resources will be issued for the user device of the first type to a different resource that is formatted for presentation on the user device of the first type and is different than the particular resource that was identified as responsive to the search request, wherein a redirect to the different resource is not issued for the particular resource for a user device of a second type that is different from user devices of the first type; in response to the determination and prior to providing the search results in response to the search request, removing, by a data processing apparatus and from a search result for the particular resource, a link that initiates a request for the particular resource and replacing, in the search result, the removed link with a different link that initiates a request for the different resource in response to user interaction with the search result for the particular resource such that the search result for the particular resource includes the different link to the different resource and does not include the link to the particular resource; and providing, to the user device of the first type, a set of search results responsive to the search request, the set of search results including the search result for the particular resource that includes the different link that initiates the request for the different resource and that does not include the removed link.
 3. The method of claim 2, wherein determining that a redirect for a particular resource from the set of responsive resources will be issued for the user device of the first type comprises: determining that the user device of the first type is a mobile device; and determining that a resource request for the particular resource from a mobile device will cause the mobile device to be redirected.
 4. The method of claim 3, wherein determining that a redirect for a particular resource from the set of responsive resources will be issued comprises: receiving redirect data specifying one or more resources that have been identified as a redirect resource, a redirect resource being a resource that will cause at least one user device to request a different resource in response to a resource request for the redirect resource; determining that an identifier for the particular resource is included in the redirect data; and determining that the redirect data for the particular resource indicate that the particular resource causes mobile devices to be redirected to the different resource in response to a request for the particular resource from the mobile devices.
 5. The method of claim 3, further comprising determining that a redirect for a particular resource from the set of responsive resources will not be issued for non-mobile devices.
 6. The method of claim 5, further comprising: receiving data that specify a search result for the particular resource, the search result including a link to the particular resource; determining that the search result is being provided to a non-mobile device; and providing the search result to the non-mobile device, the search result including the link to the particular resource.
 7. A non-transitory computer storage medium encoded with a computer program, the program comprising instructions that when executed by data processing apparatus cause the data processing apparatus to perform operations comprising: receiving data that specify a set of responsive resources for a search request that was submitted by a user device, and identification data indicating that the user device is a user device of a first type; determining, by a data processing apparatus and prior to providing search results in response to the search request, that a redirect for a particular resource from the set of responsive resources will be issued for the user device of the first type to a different resource that is formatted for presentation on the user device of the first type and is different than the particular resource that was identified as responsive to the search request, wherein a redirect to the different resource is not issued for the particular resource for a user device of a second type that is different from user devices of the first type; in response to the determination and prior to providing the search results in response to the search request, removing, by a data processing apparatus and from a search result for the particular resource, a link that initiates a request for the particular resource and replacing, in the search result, the removed link with a different link that initiates a request for the different resource in response to user interaction with the search result for the particular resource such that the search result for the particular resource includes the different link to the different resource and does not include the link to the particular resource; and providing, to the user device of the first type, a set of search results responsive to the search request, the set of search results including the search result for the particular resource that includes the different link that initiates the request for the different resource and that does not include the removed link.
 8. The non-transitory computer readable medium of claim 7, wherein determining that a redirect for a particular resource from the set of responsive resources will be issued for the user device of the first type comprises: determining that the user device of the first type is a mobile device; and determining that a resource request for the particular resource from a mobile device will cause the mobile device to be redirected.
 9. The non-transitory computer readable medium of claim 8, wherein determining that a redirect for a particular resource from the set of responsive resources will be issued comprises: receiving redirect data specifying one or more resources that have been identified as a redirect resource, a redirect resource being a resource that will cause at least one user device to request a different resource in response to a resource request for the redirect resource; determining that an identifier for the particular resource is included in the redirect data; and determining that the redirect data for the particular resource indicate that the particular resource causes mobile devices to be redirected to the different resource in response to a request for the particular resource from the mobile devices.
 10. The non-transitory computer readable medium of claim 8, further comprising determining that a redirect for a particular resource from the set of responsive resources will not be issued for non-mobile devices.
 11. The non-transitory computer readable medium of claim 10, the operations further comprising: receiving data that specify a search result for the particular resource, the search result including a link to the particular resource; determining that the search result is being provided to a non-mobile device; and providing the search result to the non-mobile device, the search result including the link to the particular resource.
 12. A system comprising: one or more computers operable to interact with a user device and to perform operations comprising: receiving data that specify a set of responsive resources for a search request that was submitted by a user device, and identification data indicating that the user device is a user device of a first type; determining, by a data processing apparatus and prior to providing search results in response to the search request, that a redirect for a particular resource from the set of responsive resources will be issued for the user device of the first type to a different resource that is formatted for presentation on the user device of the first type and is different than the particular resource that was identified as responsive to the search request, wherein a redirect to the different resource is not issued for the particular resource for a user device of a second type that is different from user devices of the first type; in response to the determination and prior to providing the search results in response to the search request, removing, by a data processing apparatus and from a search result for the particular resource, a link that initiates a request for the particular resource and replacing, in the search result, the removed link with a different link that initiates a request for the different resource in response to user interaction with the search result for the particular resource such that the search result for the particular resource includes the different link to the different resource and does not include the link to the particular resource; and providing, to the user device of the first type, a set of search results responsive to the search request, the set of search results including the search result for the particular resource that includes the different link that initiates the request for the different resource and that does not include the removed link.
 13. The system of claim 12, wherein determining that a redirect for a particular resource from the set of responsive resources will be issued for the user device of the first type comprises: determining that the user device of the first type is a mobile device; and determining that a resource request for the particular resource from a mobile device will cause the mobile device to be redirected.
 14. The system of claim 12, wherein determining that a redirect for a particular resource from the set of responsive resources will be issued comprises: receiving redirect data specifying one or more resources that have been identified as a redirect resource, a redirect resource being a resource that will cause at least one user device to request a different resource in response to a resource request for the redirect resource; determining that an identifier for the particular resource is included in the redirect data; and determining that the redirect data for the particular resource indicate that the particular resource causes mobile devices to be redirected to the different resource in response to a request for the particular resource from the mobile devices.
 15. The system of claim 12, further comprising determining that a redirect for a particular resource from the set of responsive resources will not be issued for non-mobile devices.
 16. The system of claim 15, the operations further comprising: receiving data that specify a search result for the particular resource, the search result including a link to the particular resource; determining that the search result is being provided to a non-mobile device; and providing the search result to the non-mobile device, the search result including the link to the particular resource. 